# frozen_string_literal: true

require './awdb'

def locate(awdb_fn, ip)
    db = AWDB::Data.new(awdb_fn) 
    loc = db.locate(ip) 
    return loc
end

file_name='test.awdb'
ip = "211.112.21.0"
#ip = "2001:0200:0000:6805:ffff:ffff:ffff:ffff"
loc = locate(file_name, ip)
puts loc

#eg: 
# ruby example.rb
